package com.emergency.engine.dao;

import com.emergency.engine.domain.TimeLine;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;


import java.util.List;


/**
 * Created by asus on 2020/3/11.
 */
public interface TimeLineDao extends JpaRepository<TimeLine,String>, JpaSpecificationExecutor<TimeLine> {
    @Query(value ="SELECT * FROM bus_time_line WHERE status = ?1", nativeQuery=true)
    List<TimeLine> findAllByStatus(int status);

    @Query(value ="SELECT * FROM bus_time_line WHERE scenar_id = ?1", nativeQuery=true)
    TimeLine findByScenarId(Long scenarId);

}
